﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Data;
using System.Data.SqlClient;

namespace GPCSC.Web.AJAX
{
    /// <summary>
    /// seldw 的摘要说明
    /// </summary>
    public class seldw : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        #region IHttpHandler 成员

        bool IHttpHandler.IsReusable
        {
            get { throw new NotImplementedException(); }
        }

        void IHttpHandler.ProcessRequest(HttpContext context)
        {

            string sdf = Usual.f_querystringToString("postid");
            Hashtable hta = new Hashtable();
            hta.Add("@CL_POST_SOID", sdf);
            DataSet ds = new DataReturn().ReturnData(hta, "sel_post_bypostid");
            string retustring = "";
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    retustring += dr["CL_POST_SOID"].ToString();
                    retustring += "|";
                    retustring += dr["POSTNAME"].ToString();
                    retustring += "#";
                }

            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                retustring = retustring.Substring(0, retustring.Length - 1); ;
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(retustring);

        }

        #endregion
    }
}